package reviewpolymorphism;
class Shape {
    public void draw() {
        System.out.println("画图形！");
    }
}

class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("画矩形！");
    }
}

class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("画圆！");
    }
}

class Triangle extends Shape {
    @Override
    public void draw() {
        System.out.println("画一个三角形！");
    }
}
public class Test {

    public static void main(String[] args) {
        Shape shape1 = new Rect();
        shape1.draw();

        Shape shape2 = new Cycle();
        shape2.draw();

        Shape shape3 = new Triangle();
        shape3.draw();
    }
}
